'use strict';

var __importDefault =
	(this && this.__importDefault) ||
	function(mod) {
		return mod && mod.__esModule ?
			mod : {
				default: mod
			};
	};

exports.__esModule = true;
/*
  两种网络请求：postRequest => POST, getRequest => GET
  请求头header: 默认json，支持自定义({})或快速写入('form', 'json')
*/

var request_1 = require('../../utils/request');

var globalData_1 = require('../../globalData');

var marketingRequest = new request_1['default']({
	ApiUrl: globalData_1['default'].marketingUrl
}); //我的优惠券列表 (未使用和退款冻结的)

exports.getPageCoupon = function(params) {
	return marketingRequest.getRequest({
		url: 'app/user/coupon/pageCoupon',
		data: params
	});
}; //-优惠券-限部分站点详情

exports.getPageCouponDetail = function(params) {
	return marketingRequest.getRequest({
		url: 'app/user/coupon/applyStation',
		data: params
	});
};


exports.expireCount = function() {
	return marketingRequest.getRequest({
		url: 'app/user/coupon/expireCount'
	});
}; //获取没有使用但快过期的优惠券数量 (三天内将过期的优惠券) 返回数量如果为空或者0则代表没有过期的优惠券

exports.notUseCount = function() {
	return marketingRequest.getRequest({
		url: 'app/user/coupon/notUseCount'
	});
};





//领取优惠券
exports.voucherExchangeCode = function(params) {
	return marketingRequest.getRequest({
		url: `app/user/coupon/voucherExchange/${params}`,
	});
};

//优惠券列表
exports.getCouponCenterLists = function(memberType) {
	return marketingRequest.getRequest({
		url: `app/user/coupon/list/${memberType}`,
	});
};
//【充电流程-个人钱包】优惠券选择
exports.powerOtherCouponSelectionList = function(params, stationId) {
	return marketingRequest.postRequest({
		url: `app/user/coupon/powerOtherCouponSelectionList`,
		data: params
	});
};
//【充电流程-个人钱包】卡券选择
exports.powerOtherCardSelectionList = function(params) {
	return marketingRequest.postRequest({
		url: `app/user/card/powerOtherCardSelectionList`,
		data: params
	});
};
//优惠券列表
exports.getcouponCentercouponLists = function() {
	return marketingRequest.getRequest({
		url: `app/user/coupon/couponCenterList`,
	});
};

//卡券列表
exports.getCardList = function(memberType) {
	return marketingRequest.getRequest({
		url: `app/user/card/list/${memberType}`,
	});
};

// 权益列表
exports.getEquityList = function(memberType) {
	return marketingRequest.getRequest({
		url: `app/user/equity/list/${memberType}`,
	});
};

// 券详情
exports.couponDetails = function(params) {
	return marketingRequest.getRequest({
		url: `app/user/coupon/${params}`,
	});
};

//历史券
exports.historyCouponList = function(type, memberType) {
	return marketingRequest.getRequest({
		url: `app/user/coupon/historyCoupon/${type}/${memberType}`
	});
};

//-历史-删除优惠券
exports.deleteCoupon = function(params) {
	return marketingRequest.getRequest({
		url: 'app/user/coupon/deleteCoupon',
		data: params
	});
}

//历史卡
exports.historyCardList = function(type, memberType) {
	return marketingRequest.getRequest({
		url: `app/user/card/historyCard/${type}/${memberType}`
	});
};

//-历史-删除卡券
exports.deleteCard = function(params) {
	return marketingRequest.getRequest({
		url: 'app/user/card/deleteCard',
		data: params
	});
}

//历史权益
exports.historyEquityList = function(type, memberType) {
	return marketingRequest.getRequest({
		url: `app/user/equity/historyEquity/${type}/${memberType}`
	});
};

//-历史-删除权益
exports.deleteEquity = function(params) {
	return marketingRequest.getRequest({
		url: 'app/user/equity/deleteEquity',
		data: params
	});
}
exports.getUserCardList = function() {
	return marketingRequest.getRequest({
		url: 'app/user/card/list'
	});
};
// 卡详情
exports.cardDetails = function(id) {
	return marketingRequest.getRequest({
		url: `app/user/card/${id}`
	});
};
exports.getUserEquityList = function() {
	return marketingRequest.getRequest({
		url: 'app/user/equity/list'
	});
};
// 扫码领券
exports.couponScan = function(id) {
	return marketingRequest.getRequest({
		url: `app/user/coupon/couponScanById/${id}`
	});
};
//查询领取优惠券详情(新接口)
exports.getCouponDetailById = function(id) {
	return marketingRequest.getRequest({
		url: `app/user/coupon/couponDetailById/${id}`,
	});
};
// 优惠券详情
exports.couponDetails = function(id) {
	return marketingRequest.getRequest({
		url: `app/user/coupon/${id}`
	});
};
// 权益详情
exports.couponequityDetails = function(id) {
	return marketingRequest.getRequest({
		url: `app/user/equity/${id}`
	});
};
//领券中心-立即领取
exports.voucherPackageCollection = function(id) {
	return marketingRequest.getRequest({
		url: `app/user/coupon/voucherPackageCollection/${id}`
	});
};